<template>
    <slot :controller="controller" :store="store" :model="model" :noPadding="noPadding">
        <div :id="controlID" :name="model.codeName" :class="classNames" style="">
            <AppDashboard v-bind="$attrs" :noPadding="noPadding" :layoutOpts="model.layoutOpts">
                <slot name="IBIZAPPVIEWappViewAmountPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPVIEWappViewAmountPortlet
                        name="db_sysportlet5"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPCTRLappCtrlAmountPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPCTRLappCtrlAmountPortlet
                        name="db_sysportlet6"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPEDITORappEditorAmountPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPEDITORappEditorAmountPortlet
                        name="db_sysportlet7"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPEXTENDEDITORappExtendEditorAmountPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPEXTENDEDITORappExtendEditorAmountPortlet
                        name="db_sysportlet10"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPVIEWviewChartPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPVIEWviewChartPortlet
                        name="db_sysportlet2"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPVIEWappViewListPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPVIEWappViewListPortlet
                        name="db_sysportlet1"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPCTRLctrlChartPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPCTRLctrlChartPortlet
                        name="db_sysportlet3"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPCTRLappCtrlListViewPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPCTRLappCtrlListViewPortlet
                        name="db_sysportlet8"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPEDITOReditorChartPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPEDITOReditorChartPortlet
                        name="db_sysportlet4"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPEDITORappEditorListViewPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPEDITORappEditorListViewPortlet
                        name="db_sysportlet9"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPEXTENDEDITORappExtendEditorChartPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPEXTENDEDITORappExtendEditorChartPortlet
                        name="db_sysportlet11"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
                <slot name="IBIZAPPEXTENDEDITORappExtenfEditorListViewPortlet" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                    <IBIZAPPEXTENDEDITORappExtenfEditorListViewPortlet
                        name="db_sysportlet12"
                        :context="store.context"
                        :viewParams="store.viewParams"
                        :pLoadingHelper="store.loadingHelper"
                        :pViewCtx="store.viewCtx"
                        @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                        @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                        @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"
                    />
                </slot>
            </AppDashboard>
        </div>
    </slot>
</template>
<script setup lang="ts">
// 基于template/src/widgets/{{appEntities}}/{{ctrls@DASHBOARD}}-dashboard/{{spinalCase ctrl.codeName}}-dashboard-base.vue.hbs生成
import { AppDashboard } from '@components/widgets/dashboard';
import { useProps, useBasic, useAction, useController } from './app-portal-view-db-dashboard-hook';
import { DashboardActionType, IDashboardAbility, IDashboardStore, IParam } from "@/core/interface";
import IBIZAPPVIEWappViewAmountPortlet from '@widgets/ibizappview/app-portal-view-db-app-view-amount-portlet/app-portal-view-db-app-view-amount-portlet.vue';
import IBIZAPPCTRLappCtrlAmountPortlet from '@widgets/ibizappctrl/app-portal-view-db-app-ctrl-amount-portlet/app-portal-view-db-app-ctrl-amount-portlet.vue';
import IBIZAPPEDITORappEditorAmountPortlet from '@widgets/ibizappeditor/app-portal-view-db-app-editor-amount-portlet/app-portal-view-db-app-editor-amount-portlet.vue';
import IBIZAPPEXTENDEDITORappExtendEditorAmountPortlet from '@widgets/ibizappextendeditor/app-portal-view-db-app-extend-editor-amount-portlet/app-portal-view-db-app-extend-editor-amount-portlet.vue';
import IBIZAPPVIEWviewChartPortlet from '@widgets/ibizappview/app-portal-view-db-view-chart-portlet/app-portal-view-db-view-chart-portlet.vue';
import IBIZAPPVIEWappViewListPortlet from '@widgets/ibizappview/app-portal-view-db-app-view-list-portlet/app-portal-view-db-app-view-list-portlet.vue';
import IBIZAPPCTRLctrlChartPortlet from '@widgets/ibizappctrl/app-portal-view-db-ctrl-chart-portlet/app-portal-view-db-ctrl-chart-portlet.vue';
import IBIZAPPCTRLappCtrlListViewPortlet from '@widgets/ibizappctrl/app-portal-view-db-app-ctrl-list-view-portlet/app-portal-view-db-app-ctrl-list-view-portlet.vue';
import IBIZAPPEDITOReditorChartPortlet from '@widgets/ibizappeditor/app-portal-view-db-editor-chart-portlet/app-portal-view-db-editor-chart-portlet.vue';
import IBIZAPPEDITORappEditorListViewPortlet from '@widgets/ibizappeditor/app-portal-view-db-app-editor-list-view-portlet/app-portal-view-db-app-editor-list-view-portlet.vue';
import IBIZAPPEXTENDEDITORappExtendEditorChartPortlet from '@widgets/ibizappextendeditor/app-portal-view-db-app-extend-editor-chart-portlet/app-portal-view-db-app-extend-editor-chart-portlet.vue';
import IBIZAPPEXTENDEDITORappExtenfEditorListViewPortlet from '@widgets/ibizappextendeditor/app-portal-view-db-app-extenf-editor-list-view-portlet/app-portal-view-db-app-extenf-editor-list-view-portlet.vue';
// 输入参数
const props = defineProps(useProps());

// 基础数据
const { 
    model,
    controlID, 
    getClassNames, 
    useNavParamsBind, 
    useEventBind, 
    handleCtrlDestroy,
    handleCtrlInit, 
    handleCtrlAction,
} = useBasic(props);

const emit = defineEmits<{
    (event: 'ctrl-action', name: string, action: DashboardActionType, data: IParam[]): void;
    (event: 'ctrl-init', name: string, data: IDashboardAbility): void;
    (event: 'ctrl-destroy', name: string, data: IParam): void;
}>();

const evt = useEventBind(emit);
const classNames = computed(() => {
    return getClassNames(props);
});

const controller = useController(props, evt, { controlID });

useNavParamsBind(controller, props);

const store: IDashboardStore = controller.getStore();

onMounted(() => {
    controller.ctrlMounted();
});

onUnmounted(() => {
    controller.ctrlDestroy();
})
</script>